/*
例程202. 序列排序
整理优化by:千百度QAIU
QQ:736226400
编译环境:gcc/tcc
2017/10/25
*/

#include <stdio.h>
void jsValue(int a[10][9]) {
  int i, j, k, val, num;
  for (i = 0; i < 10; i++) {
    val = a[i][0];
    for (j = 0; j < 9; j++)
      if (a[i][j] < val) {
        num = a[i][j];
        for (k = j; k > 0; k--)
          a[i][k] = a[i][k - 1];
        a[i][0] = num;
      }
  }
}
int main() {
  int a[10][9] = { 
  {6, 8, 9, 1, 2, 5, 4, 7, 3},
  {3, 5, 8, 9, 1, 2, 6, 4, 7},
  {8, 2, 1, 9, 3, 5, 4, 6, 7},
  {3, 5, 1, 2, 9, 8, 6, 7, 4},
  {4, 7, 8, 9, 1, 2, 5, 3, 6},
  {4, 7, 3, 5, 1, 2, 6, 8, 9},
  {9, 1, 3, 5, 8, 6, 2, 4, 7},
  {2, 6, 1, 9, 8, 3, 5, 7, 4},
  {5, 3, 7, 9, 1, 8, 2, 6, 4},
  {7, 1, 3, 2, 5, 8, 9, 4, 6},
  };
  int i, j;
  jsValue(a);
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 9; j++) {
      printf("%d", a[i][j]);
      if (j <= 7)
        printf(",");
    }
    printf("\n");
  }
  return 0;
}